Read Discrete Inputs

t, err = mbo:rdi(adr, fc, nc, [ms])
t, err = modbus.rdi(cpo, adr, fc, nc, [ms])

Read discrete inputs (Modbus function 02)

Parameter Type Description
mbo object table Modbus Object
cpo object COM Port Object
adr integer Slave address
fc integer First coil to read
nc integer Number of coils to read
ms integer Receive timeout
Returns Type Description
t table Boolean values (one for each input)
err string Modbus error (if applicable)
Note

This is a bit access function.